﻿#ifndef CGlobal_H
#define CGlobal_H
#include <QString>
#define A2T QString::fromLocal8Bit
#define FL  __FILE__+(","+QString::number(__LINE__)) 

#define _Q(x) (x).toLocal8Bit().data()                  //QString中含有中文转char * 需要使用toLocal8Bit().data() 
#define _QStr2CharStr(x) x.toStdString().c_str()        //将QString 转化成 char* 字符串
#define _QSClearPoint(x)  QString::number(x.toDouble(), 'f', 0).toStdString().c_str()        //将QString 转化成 char* 字符串 同时去除对应的小数位
#define _QNumStr2UInt(x) (unsigned int)x.toDouble()     //将QString 数值转化成unsigned int
#define _QNumStr2Int(x) (int)x.toDouble()               //将QString 数值转化

//安全释放指针
#define SAFE_DELETE(p) \
{ \
if (NULL != p) \
{ \
	delete p; \
	p = NULL; \
} \
}

//安全释放数组指针
#define SAFE_DELETE_A(p) \
{ \
if (NULL != p) \
{ \
	delete[] p; \
	p = NULL; \
} \
}

extern QString g_sTableName;
extern QString g_sResultPath;
extern QString g_sHttpUrl;
extern QString g_sCustomName;
extern int g_nResultTime;


#endif // !CGlobal_H

